package com.sunny.blog.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sunny.blog.pojo.BlogInfoBean;
import com.sunny.blog.pojo.BlogTypeBean;
import com.sunny.blog.pojo.QueryBlogBean;
import com.sunny.blog.pojo.TagGroupBean;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: BloggerInfoMapper
 * @Description:
 * @Author: sunt
 * @Date: 2020/4/22 14:08
 * @Version 1.0
 **/
@Repository
public interface CommonBlogMapper {

    /**
     * 标签分类查询
     * @return
     */
    List<TagGroupBean> queryTagGroupInfo();

    /**
     * 按分类统计
     * @return
     */
    List<BlogTypeBean> queryBlogTypeGroupInfo();

  /**
     * 博客分页按条件查询
     * @param page
     * @param blogBean
     * @return
     */
    List<BlogInfoBean> queryBlogList(Page<BlogInfoBean> page, @Param("blogBean") QueryBlogBean blogBean);

    /**
     * 相似文章查询
     * @param page
     * @param blogId
     * @return
     */
    List<BlogInfoBean> querySimilarList(Page<BlogInfoBean> page, @Param("blogId") String blogId);

    /**
     * 按月统计博客信息
     * @return
     */
    List<Map<String, Object>> blogStaticByMonth();

    /**
     * 按月查询明细
     * @param releaseDate
     * @return
     */
    List<Map<String, Object>> queryBlogByDate(@Param("releaseDate") String releaseDate);
}
